package com.test.mooan.labama.utils_boom;

public class LoanStatusUtil {

    public interface EnumOrderStatus_boom {
        String LENDING = "LENDING";
        String PENDING = "PENDING";
        String LOANED = "LOANED";
        String REPAYMENT = "REPAYMENT";
        String ANNUL_SETTLE = "ANNUL_SETTLE";
        String NO = "NO";
        String OVERDUE = "OVERDUE";
        String OVERDUE_ANNUL_SETTLE = "OVERDUE_ANNUL_SETTLE";
        String BAD_DEBT = "BAD_DEBT";
        String CREATED = "CREATED";
        String DENIED = "DENIED";
        String SETTLE = "SETTLE";
        String OVERDUE_SETTLE = "OVERDUE_SETTLE";
    }

    public interface EnumApplyStatus_boom {
        String BACKTO = "BACKTO";
        String SUCCEEDED = "SUCCEEDED";
        String CANCEL = "CANCEL";
        String CREATED = "CREATED";
        String SYS_APROVAL = "SYS_APROVAL";
        String SYS_CHECK = "SYS_CHECK";
        String SYS_DENIED = "SYS_DENIED";
        String MANU_APROVAL = "MANU_APROVAL";
        String MANU_DENIED = "MANU_DENIED";
        String DS_DENIED = "DS_DENIED";
        String DS_APROVAL = "DS_APROVAL";
    }


    public enum LoanStatus {
        ///////////////////
        No_Order,//没有订单
        Loan_Reviewing,//申请审核中
        Order_Pending,//待放款
        Loan_Rejected,//申请拒绝
        Order_Pending_Repayment,//待还款，未逾期
        Order_Overdue_Repayment,//待还款,已逾期
    }

    /**
     * 待放款
     */
    public static boolean isOrderLoaning(String orderStatus) {
        return EnumOrderStatus_boom.CREATED.equalsIgnoreCase(orderStatus) ||
                EnumOrderStatus_boom.LENDING.equalsIgnoreCase(orderStatus) ||
                EnumOrderStatus_boom.PENDING.equalsIgnoreCase(orderStatus);
    }

    /**
     * 待还款-未逾期
     */
    public static boolean isOrderPendingRepayment(String orderStatus) {
        return EnumOrderStatus_boom.LOANED.equalsIgnoreCase(orderStatus) ||
                EnumOrderStatus_boom.REPAYMENT.equalsIgnoreCase(orderStatus);
    }

    /**
     * 待还款-已逾期
     */
    public static boolean isOrderOverdueRepayment(String orderStatus) {
        return (EnumOrderStatus_boom.OVERDUE.equalsIgnoreCase(orderStatus) ||
                EnumOrderStatus_boom.BAD_DEBT.equalsIgnoreCase(orderStatus));
    }

    /**
     * 申请拒绝
     */
    public static boolean isLoanRejcted(String applyStatus, String orderStatus) {
        return (EnumOrderStatus_boom.DENIED.equalsIgnoreCase(orderStatus) ||
                EnumApplyStatus_boom.SYS_DENIED.equalsIgnoreCase(applyStatus) ||
                EnumApplyStatus_boom.MANU_DENIED.equalsIgnoreCase(applyStatus) ||
                EnumApplyStatus_boom.DS_DENIED.equalsIgnoreCase(applyStatus));
    }

    /**
     * 申请审核中
     */
    public static boolean isLoanReviewing(String applyStatus) {
        return (EnumApplyStatus_boom.CREATED.equalsIgnoreCase(applyStatus) ||
                EnumApplyStatus_boom.SYS_CHECK.equalsIgnoreCase(applyStatus) ||
                EnumApplyStatus_boom.SYS_APROVAL.equalsIgnoreCase(applyStatus) ||
                EnumApplyStatus_boom.MANU_APROVAL.equalsIgnoreCase(applyStatus) ||
                EnumApplyStatus_boom.DS_APROVAL.equalsIgnoreCase(applyStatus));
    }
    
}
